package com.fastword.demo.controller;

import com.clientAda4j.domain.ClientResponseProp;
import com.fastword.demo.domain.DefaultWeatherClientResponseProp;
import com.fastword.demo.request.WeatherService;
import com.google.common.collect.ImmutableMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/weather")
public class WeatherController {
    @Autowired
    private WeatherService weatherService;

    @GetMapping("searchList")
    public ClientResponseProp<DefaultWeatherClientResponseProp> searchList() {
        ImmutableMap<String, String> immutableMap = ImmutableMap.of("app", "weather.today", "weaId", "1", "appkey", "10003", "sign", "b59bc3ef6191eb9f747dd4e83c99f2a4", "format", "json");
        return weatherService.baseinfo(immutableMap);
    }
}
